<?php

class Zend_View_Helper_CountTerms
{
    function countTerms()
    {        
        $front = Zend_Controller_Front::getInstance();
        $container = $front->getParam('bootstrap')->getContainer();
        $db = $container->db;
        
        $sql = 'SELECT count(*) as total FROM terms t';                
        $result = $db->fetchAll($sql);
        
        return $result[0]['total'];
    }
}